*------------- Upper-Body Strength and Political Egalitarianism: Twelve Conceptual Replications ------------------------------------*
*--------------------------------------------- Experiment, Discussion Section ------------------------------------------------------*

*** Creates Social Dominance Orientation variables for pre and post intervention (pre and post training program)
* Pre-intervention SDO variable
alpha SDO_v18 SDO_v19 SDO_v20 SDO_v21 SDO_v22 SDO_v23 SDO_v24 SDO_v25 SDO_v26 SDO_v27 SDO_v28 SDO_v29 SDO_v30 SDO_v31 SDO_v32 SDO_v33, gen(SDO1)


* Post-intervention SDO variable
alpha SDO2_v24 SDO2_v25 SDO2_v26 SDO2_v27 SDO2_v28 SDO2_v29 SDO2_v30 SDO2_v31 SDO2_v32 SDO2_v33 SDO2_v34 SDO2_v35 SDO2_v36 SDO2_v37 SDO2_v38 SDO2_v39, gen(SDO2)


** Creates difference score variable for PRE-intervention SDO and POST-intervention SDO
gen SDOdiff=SDO2-SDO1


*** Intervention variable
clonevar Resistance_Training = Kontrolstimuli
label define Rest_trainingLB 0 "Endurance Training" 1 "Resistance Training"
label values Resistance_Training Rest_trainingLB


*** Physical strength variable (number of push-ups)
* Pre-intervention measure
clonevar Phys_strength_r1 = Styrke1

* Post-intervention measure
clonevar Phys_strength_r2 = Styrke2


*--------------------------------------------------------- REPORTED ANALYSES ----------------------------------------------------*
*** Correlation between physical strength (number of push-ups) and SDO in PRE-intervention round:
pwcorr SDO1 Phys_strength_r1, sig obs


*** Gain in physical strength (number of push-ups) as a function of assignment to the intervention (endurance or resistance training):
bys Resistance_Training: ttest Phys_strength_r2==Phys_strength_r1


*** Increase in SDO across time from round 1 to round 2:

* All participants - regardless of assignment to endurance or resistance intervention
ttest SDOdiff==0

* only ENDURANCE training participants
ttest SDOdiff==0 if Resistance_Training==0

* only RESISTANCE training participants
ttest SDOdiff==0 if Resistance_Training==1

** Tests if increase among RESISTANCE training participants is significantly larger than among ENDURANCE training participants
reg SDOdiff i.Resistance_Training


*** Creates Figure reported as Figure 3 in the article
reg SDOdiff
margins
estimates store m1
reg SDOdiff if Resistance_Training == 0
margins
estimates store m2
reg SDOdiff if Resistance_Training == 1
margins
estimates store m3

coefplot (m1, keep("_cons")) (m2, keep("_cons")) (m3, keep("_cons")), title("") recast(bar) barw(.2) ///
ciopts(recast(rcap) lpattern(dash) color(black) lwidth(thin)) ///
citop yline(0) msize(medlarge) vertical yscale(range(-.2 .4)) ylabel(-.2(.1).4, nogrid) graphregion(fcolor(white)) ///
xlabel(none) ytitle("Change in SDO from T1 to T2") legend (order(1 3 5) cols(1) ///
	label(1 "All Subjects") ///
	label(3 "Endurance Training Group") ///
	label(5 "Resistance Training Group") size(medium)) ///
	scheme(s2mono) graphregion(lcolor(black) fcolor(white))
graph display, ysize(4) xsize(5)


*** Power analysis for needed sample size if obtained results were to be statistically significant
power twomeans .05 .16, sd1(.53) sd2(.57)
